#
# Be sure to run `pod lib lint CYBaseKit.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name = 'CYBaseKit'
  s.version = '0.1.8'
  s.summary = 'A short description of CYBaseKit.'

  # This description is used to generate tags and improve search results.
  #   * Think: What does it do? Why did you write it? What is the focus?
  #   * Try to keep it short, snappy and to the point.
  #   * Write the description between the DESC delimiters below.
  #   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description = <<-DESC
TODO: Add long description of the pod here.
  DESC

  s.homepage = 'https://gitee.com/zfr-project/cybase-kit'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license = { :type => 'MIT', :file => 'LICENSE' }
  s.author = { '122674287@qq.com' => '122674287@qq.com' }
  s.source = { :git => 'https://gitee.com/zfr-project/cybase-kit.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '9.0'

  s.source_files = 'CYBaseKit/CYBaseKit.h'

  # s.source_files = 'CYBaseKit/Classes/**/*'
  s.subspec 'Classes' do |classes|

    # Category
    classes.subspec 'Category' do |category|
      category.source_files = 'CYBaseKit/Classes/Category/*.{h,m}'
      category.dependency 'CYBaseKit/Classes/Commons'
    end

    # Commons 公共
    classes.subspec 'Commons' do |commons|
      commons.source_files = 'CYBaseKit/Classes/Commons/*.{h,m}'
    end
    # Tools
    classes.subspec 'Tools' do |tools|
      tools.source_files = 'CYBaseKit/Classes/Tools/*.{h,m}'
    end

    # 基础Model
    classes.subspec 'Model' do |model|
      model.source_files = 'CYBaseKit/Classes/Model/*.{h,m}'
      model.dependency 'MJExtension'
    end

    # View
    classes.subspec 'View' do |view|
      view.source_files = 'CYBaseKit/Classes/View/*.{h,m}'
      view.dependency 'Masonry'
      view.dependency 'CYBaseKit/Classes/Category'
    end

    # Controller
    classes.subspec 'ViewController' do |viewController|
      viewController.source_files = 'CYBaseKit/Classes/ViewController/*.{h,m}'
      viewController.dependency 'CYBaseKit/Classes/Category'
      viewController.dependency 'CYBaseKit/Classes/Commons'
    end

    # 组件模块
    classes.subspec 'Modules' do |modules|
      modules.source_files = 'CYBaseKit/Classes/Modules/**/*.{h,m}'
      modules.dependency 'CYBaseKit/Classes/Commons'
      modules.dependency 'CYBaseKit/Classes/Category'
      modules.dependency 'CYBaseKit/Classes/Tools'
      modules.dependency 'CYBaseKit/Classes/View'
      modules.dependency 'MJRefresh'
    end
  end
  # 资源类
  s.subspec 'Assets' do |assets|
    # 图片资源
    assets.subspec 'Images' do |images|
      images.resource_bundles = {
        'CYBaseKit' => ['CYBaseKit/Assets/images/*.png']
      }
    end
  end

  # s.public_header_files = 'Pod/Classes/**/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'
end
